#ifndef SERIALBASE_H
#define SERIALBASE_H

#include <QString>
#include <iostream>
#include <QDebug>
#include "boost/signals2.hpp"

typedef struct Tag_NamePort
{
    std::string name;
    uint port;
    bool isOpen;
}Tag_NP;

class SerialBase
{
public:
    SerialBase();

    virtual QStringList ScanSerial();
    ///
    virtual std::string SendUntilRec(const char *sendBuf,int msecs = 3000);
    ///
    virtual bool GetOpened();


    ///
    virtual void OpenPort(const char *bau,int port);

    ///
    virtual void CloseSerial();

    ///
    virtual void SendBuff(const char *sendBuf);

    virtual bool ReadBuff();

    Tag_NP pInfo;   /// 存储通信端口

    boost::signals2::signal<void(std::string)> _sigUpdate;
};

#endif // SERIALBASE_H
